#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdio.h>
#include<string.h>

//int main()
//{
//	int n;
//	scanf("%d", &n);
//	char arr[100];
//	scanf("%s", &arr);
//	int count1 = 0;
//	int count2 = 0;
//	for (int i = 0; arr[i] != '\0'; i++)
//	{
//		if (arr[i] == '(')
//			count1++;
//		if (arr[i] == ')')
//			count2++;
//	}
//	if (count1 == count2)
//	{
//		printf("parentheses match!");
//	}
//	else
//		printf("parentheses do not match!");
//	return 0;
//}

typedef struct student
{
	char name[20];
	char mode[20];
	int score[5];
	double average;
	int total;
}student;

int main()
{
	int n;
	scanf("%d", &n);
	student a[20];
	for (int i = 0; i < n; i++)
	{
		fgets(a[i].name,20,stdin);
		fgets(a[i].mode,20,stdin);
		int sum = 0;
		for (int j = 0; j< 5;j++)
		{
			scanf("%d", &a[i].score[j]);
			sum = sum + a[i].score[j];
		}
		a[i].average = sum * 1.0 / 5;
		a[i].total = sum;
		/*for (int k = 0;k< 5;k++)
		{
			for (int j = 0; j < 5; j++)
			{
				if (a[i].score[k] < a[i].score[k])
				{
					int tmp = a[i].score[k];
					a[i].score[k] = a[i].score[j];
					a[i].score[j] = tmp;
				}
			}
		}*/
	}
	student* b[100];
	for (int i = 0; i < n; i++)
	{
		b[i] = &a[i];
	}
	for (int i = 0; i < n; i++)
	{

		printf("Name:%s\n",b[i]->name);
		printf("ID:%s\n",b[i]->mode);
		printf("Score:");
		for (int j = 0; j < 4; j++)
		{
			printf("%d ", b[i]->score[j]);
		}
		printf("%d\n", b[i]->score[4]);
		printf("average:%.2lf ", b[i]->average);
		printf("total:%d\n", b[i]->total);
		printf("\n");
	}
	return 0;
}